<?php
namespace TennisTournament\Service;

use TennisTournament\Model\Player;

interface PlayerService extends GenericService {

    /**
     * Encode a Player into a JSON format
     * @param Player $player
     * @return string
     */
    public function toJSON(Player $player);

    /**
     * Upload file to specific directory as set it as the name of a Player
     * and return the new path of this file.
     * @param array $playersPictureData
     * @param $playerName
     * @return string
     */
    public function uploadPlayerPicture($playersPictureData = array(), $playerName);

    /**
     * List all {@link Player}'s
     * @return array from all Players
     */
    public function listAll();

    /**
     * Update player stats depend of results from one Match
     * @param Player $player
     * @param array $collectionResult
     * @param $hostGuest
     * @param $isAWinner
     * @return void
     */
    public function updateStats(Player $player, array $collectionResult, $hostGuest, $isAWinner);

    /**
     * Get best scorer
     * @return Player
     */
    public function getBestScorer();
}